﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.Common.Data;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Simple.ViewModel
{
    public class UserDto : Dto<long>
    {
        /// <summary>
        /// 登录账号
        /// </summary>
        [Required(ErrorMessage="登录账号必填")]
        [Remote("IsRepeatLoginNo", "User", ErrorMessage = "该登录账号已存在")]
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string LoginNo { get; set; }

        /// <summary>
        /// 登录密码
        /// </summary>
        [Required(ErrorMessage = "登录密码必填")]
        [StringLength(16,MinimumLength=6, ErrorMessage="密码长度6-16位")]
        public string PassWord { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string ShortName { get; set; }

        /// <summary>
        /// 联系方式
        /// </summary>
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string Contact { get; set; }

        /// <summary>
        /// 角色ID
        /// </summary>
        [Required(ErrorMessage = "用户角色必填")]
        public long? RoleId { get; set; }

        /// <summary>
        /// 角色下拉列表
        /// </summary>
        public IList<SelectListItem> RoleList { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateUser
        {
            get;
            set;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreateTime
        {
            get;
            set;
        }

        /// <summary>
        /// 修改人
        /// </summary>
        public string ModifyUser
        {
            get;
            set;
        }

        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? ModifyTime
        {
            get;
            set;
        }

        /// <summary>
        /// 是否删除
        /// </summary>
        public bool IsActive
        {
            get;
            set;
        }

        /// <summary>
        /// 删除人
        /// </summary>
        public string ChangeActiveUser
        {
            get;
            set;
        }

        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTime? ChangeActiveTime
        {
            get;
            set;
        }
    }
}
